# Maintainer:
pkgname=rtmidi
pkgver=6.0.0
pkgrel=0
pkgdesc="C++ classes that provide a common API for realtime MIDI input/output"
url="https://github.com/thestk/rtmidi"
arch="all"
license="MIT"
makedepends="
	alsa-lib-dev
	cmake
	jack-dev
	samurai
	"
subpackages="$pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/thestk/rtmidi/archive/refs/tags/$pkgver.tar.gz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build

	mkdir -p "$pkgdir"/usr/lib/cmake
	mv "$pkgdir"/usr/share/rtmidi "$pkgdir"/usr/lib/cmake
	rmdir "$pkgdir"/usr/share
}

sha512sums="
7ff7f85ff86fc019ab7906a46efc986b2a340b2f9a9d504bda85d0afc75921b905b32cb37f87e30ab9d1f13e62587c4ade736dad1609a0880eeab3fe5a936acb  rtmidi-6.0.0.tar.gz
"
